package test

import (
	"fmt"
	"testing"
)

func Test_join(t *testing.T) {
	s := join()
	t.Logf("s: %v\n", s)
}

type T struct {
	A int `json:"-"`
	B int `json:"b"`
}

// // truncate
// func truncate[T string | rune](s T, n int) T {
// 	if len(s) < n {
// 		return s
// 	}
// 	return s[:n]
// }

func Test_titleFilterX(t *testing.T) {

	// a := "hh"
	var b = []rune("哈哈a")
	x := b[:3]
	fmt.Printf("b[:3]: %v\n", x)

	// x := titleFilterX(1, "### >><:::<<<< &^$#@avc AVC蓝光 光盘 # $$$ a    b")
	// s := "007"
	// x := strings.TrimLeft(s, " 0")

	// a := `{"a":11,"b":"ccc"}`
	// x := new(T)
	// json.Unmarshal([]byte(a), x)

	fmt.Printf("x: %v\n", x)
}

type User struct {
	ID      uint `gorm:"primarykey"`
	Name    string
	Courses []Course
}

type Course struct {
	ID     uint `gorm:"primarykey"`
	UserID uint
	Name   string
	Score  int
}
